home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-02
/
pavt117.zip
/
PAVTDEMO.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1991-12-23
|
3KB
|
120 lines
program PAvtDemo; { Demo of Avatar level 1 console using Crt routines }
{ Public Domain. Author: Gregory P. Smith }
{ Modification History: }
{ 07/06/91 First Coding }
{ 09/15/91 Added MoveW & FillWord }
{ procedures to speed up 30% }
{ 10/05/91 Combined the the PAvt0 & 1 }
{ demos into one program. Also }
{ placed the hooks in AVIDEO.INC }
{ 12/23/91 Added coordinate checks on all }
{ Screen Manipluations }
{$D-,L-,R-,F-,M 4096,4096,4096}
{ DEFINE AVT0} { enabling this uses PAvt0 instead of PAvt1. }
Uses Dos, Crt,
{$IFDEF AVT0}
PAvt0;
{$ELSE}
PAvt1;
{$ENDIF}
{$I AVIDEO.INC -- link in the screen I/O and user hooks. }
function UpStr(s:string): string;
var
ns : string;
i : integer;
begin
for i := 1 to length(s) do
ns[i] := upcase(s[i]);
ns[0] := s[0];
UpStr := ns;
end;
procedure Help;
begin
{$IFDEF AVT0}
Writeln('PAvt0 Demo Copr. 1991 Greg Smith');
{$ELSE}
Writeln('PAvt1 Demo Copr. 1991 Greg Smith');
{$ENDIF}
Writeln('Usage: PAVTDEMO [params] input_file [params]');
Writeln;
Writeln(' parameters (may be abbreviated):');
{$IFNDEF AVT0}
Writeln(' /PLUS Run in AVT/0+ simulation mode w/ ANSI fallback.');
{$ENDIF}
Writeln(' /ANSI Start with ANSI child active.');
Writeln(' /SLOW Slow down emulation for viewing.');
halt;
end;
var
fname : pathstr;
const
slowdown : byte = 0; { milliseconds between characters. }
procedure ProcessParams;
const
Prms = '/PLUS/ANSI/SLOW/?/HELP';
var
i,p : integer;
begin
p := paramcount;
while p > 0 do
begin
i := pos(UpStr(ParamStr(p)),Prms);
case i of
{$IFNDEF AVT0}
1 : Level0_Simulation(True);
{$ENDIF}
6 : ANSI_Only;
11 : Slowdown := 2; { set to ms between chars. }
16..18 : Help;
else
fname := ParamStr(p);
end; { case }
dec(p);
end; { while }
end; { processed in reverse so that first non-parameter is the filename }
Procedure ProgBody;
var
f : file;
buf : Array[1..1024] of char;
i,z : word;
begin
Assign(Output,''); Rewrite(Output);
Assign(Input,''); Reset(Input);
fname := '';
{$IFNDEF AVT0}
ANSI_BBS := True;
{$ENDIF}
SetScrPtr;
SetHooks;
ProcessParams;
if fname = '' then Help;
FillArea(1,1,80,25,7,' '); { Clear Screen }
Assign(f,fname);
Reset(f,1);
repeat
BlockRead(f,buf,1024,z);
for i := 1 to z do
begin
Delay(slowdown);
{$IFDEF AVT0}
AvtInterp(buf[i]);
{$ELSE}
Parse_AVT1(buf[i]);
{$ENDIF}
end;
until EOF(f); { end else }
end;
begin
ProgBody;
end.